package net.anumbrella.seaweedfs.core.content;

import lombok.Data;

import java.io.Serializable;
import java.util.List;
import java.util.Random;

/**
 * @author Administrator
 */
@Data
public class LookupVolumeResult implements Serializable {
    private long volumeId;
    private Random random = new Random();
    private List<LocationResult> locations;


    public LocationResult getRandomLocation() {
        if (locations != null) {
            return locations.get((random.nextInt(locations.size())));
        } else {
            return null;
        }
    }
}